<template>
	<view class="content">
		<web-view :src="url"></web-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				viewerUrl: '/hybrid/html/pdf/web/viewer.html',
				fileUrl: 'http://192.168.0.236:8065/profile/upload/公告.jpg',
				url: ''
			};
		},
		onLoad(params) {
			console.log(params);
			// #ifdef H5
			this.url = `${this.viewerUrl}?file=${encodeURIComponent(params.fileUrl)}`;
			// #endif

			// 在安卓和ios手机上
			// #ifdef APP-PLUS
			if (plus.os.name === 'Android') {
				this.url = `${this.viewerUrl}?file=${encodeURIComponent(params.fileUrl)}`;
			} else {
				this.url = encodeURIComponent(params.fileUrl);
			}
			// #endif
			console.log(this.url);
		},
		methods: {}
	};
</script>

<style>
</style>
